﻿Imports System.Windows.Forms

Public Class frmGlobal
    Dim Var As New varDeclare
    Dim dbBase As New dbSystem
    Dim frmCtrl As New control
    Public LoginID As String
    Public LoginUserName As String
    Public dsPermission As DataSet
    Public dsModule As DataSet
    Public dsForm As DataSet
    Private m_ChildFormNumber As Integer

    Private Sub frmGlobal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        tsCompID.Text = "Comp : " + Var.CompID
        Me.WindowState = FormWindowState.Maximized
        dsModule = dbBase.GetAllModuleList()
        dsForm = dbBase.GetAllFormList()
        frmCtrl.openChild(New frmLogin, Me)
    End Sub

    Private Sub tsViewStatusBar_Click(sender As Object, e As EventArgs) Handles tsViewStatusBar.Click
        Me.tsSystem.Visible = Me.tsViewStatusBar.Checked
    End Sub

    Private Sub tsLogOut_Click(sender As Object, e As EventArgs) Handles tsLogOut.Click
        Me.LoginID = ""
        Me.LoginUserName = ""
        frmCtrl.openChild(New frmLogin, Me)
    End Sub

    Private Sub ExitToolsStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ExitToolStripMenuItem.Click
        Me.Close()
    End Sub

    Private Sub StudentAdministrationToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SubMenuStudentManagement.Click
        Dim frm As New frmStudentList
        frm.ModuleName = "Administration"
        frmCtrl.openChild(frm, Me)
    End Sub

    Private Sub tsAbout_Click(sender As Object, e As EventArgs) Handles tsAbout.Click
        frmCtrl.openChild(New frmAbout, Me)
    End Sub

    Private Sub UserToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SubMenuLoginManagement.Click
        frmCtrl.openChild(New frmLoginUserList, Me)
    End Sub

    Private Sub EmployerManagementToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SubMenuEmployerManagement.Click
        frmCtrl.openChild(New frmEmployerManagement, Me)
    End Sub

    Private Sub SubMenuStudentBillManagement_Click(sender As Object, e As EventArgs) Handles SubMenuStudentBillManagement.Click
        Dim frm As New frmStudentList
        frm.ModuleName = "Finance"
        frmCtrl.openChild(frm, Me)
    End Sub

    Private Sub SubMenuStudentBillPayment_Click(sender As Object, e As EventArgs) Handles SubMenuStudentBillPayment.Click
        MessageBox.Show("Not included in prototype")
    End Sub

    Private Sub SubMenuEmployerSalaryManagement_Click(sender As Object, e As EventArgs) Handles SubMenuEmployerSalaryManagement.Click
        MessageBox.Show("Not included in prototype")
    End Sub

    Private Sub tsCompID_Click(sender As Object, e As EventArgs) Handles tsCompID.Click
        If (Me.LoginID = "SuperAdmin") Then
            frmCtrl.openChild(New AdminUtility, Me)
        End If
    End Sub
End Class
